import java.util.Scanner;
public class Fudian{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int num=0;
    while(sc.hasNext()){
      int sum=0;
      double a=sc.nextDouble();
      String s=String.valueOf(a);
      char []str=s.toCharArray();
      for(int i=0;i<s.length();i++){
        if (str[i]=='-'||str[i]=='.') continue;
        else{
          num=str[i]-'0';
          sum+=num;
        }
      }
      System.out.println(sum);
    }
  }
}